#pragma once
#ifndef __DETECTOR_NETWORK__H__
#define __DETECTOR_NETWORK__H__

#include <iostream>
#include <vector>
#include <math.h>
//opencv
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
//openvino
#include <openvino/openvino.hpp>
//interface
#include "armor_detector/armor.hpp"
namespace rm_auto_aim
{
class ArmorDetectorNetwork
{
private:
    ov::Core core; // Initialize OpenVINO Runtime Core
    ov::CompiledModel compiled_model;
    ov::InferRequest infer_request;

    

    // network parameter
    int img_size_;
    int enemy_color_;
    float score_threshold_;
    float nms_threshold_;

    cv::Mat letterbox(const cv::Mat &source);

public:
    /**
     * @brief 初始化
     * 
     * @param img_size_ 图像大小
     * @param model_path_ 网络路径
     * @param enemy_color_ 敌方颜色
     * @param score_threshold_ 分数阈值
     * @param nms_threshold_ nms阈值
     */
    ArmorDetectorNetwork(int img_size_,std::string model_path_,int enemy_color_,float score_threshold_,float nms_threshold_);
    ~ArmorDetectorNetwork();
    std::vector<Armor> detect(cv::Mat& img);
    /**
     * @brief 绘制识别结果
     * 
     * @param __DebugNet_img 用于绘制的图像
     * @param id 
     * @param conf 
     * @param armor_verticles_ 角点vector
     */
    void DrawResult(cv::Mat& __DebugNet_img,int id, float conf, std::vector<cv::Point2f> armor_verticles_);
};
}
#endif